Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Why is the metadata of a video file not displayed?
Forum Updated to NodeBB v4.3 + New Features

Why is the metadata of a video file not displayed?

Scheduled Pinned Locked Moved Unsolved General and Desktop
7 Posts 3 Posters 1.1k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • H Offline
    H Offline
    haifisch
    wrote on last edited by
    #1

    I need to get the metadata from the video file:

    QMediaMetaData::GPSLatitude,QMediaMetaData::GPSLongitude and  QMediaMetaData::DateTimeOriginal.
    

    I do it this way:

    QMediaPlayer *player = new QMediaPlayer(this);
    player->setMedia(QUrl::fromLocalFile(model->index(i,1).data().toString()));
    QString GPSLatitudeVideo = "";
    QString GPSLongitudeVideo = "";
    QString DateTimeOriginalVideo = "";
    qDebug()<<model->index(i,1).data().toString()<<"+++";
    
    //if (player->isMetaDataAvailable())
    //{
    /* YOUR CODE HERE SUCH AS*/
        GPSLatitudeVideo = player->metaData(QMediaMetaData::GPSLatitude).toString();
        GPSLongitudeVideo = player->metaData(QMediaMetaData::GPSLongitude).toString();
        DateTimeOriginalVideo = player->metaData(QMediaMetaData::DateTimeOriginal).toString();
        qDebug()<<"+++"<<GPSLatitudeVideo<<GPSLongitudeVideo<<DateTimeOriginalVideo;
    //}
    

    But metadata is not displayed:

    "I://Сб_апр_21_2018_21_45_56/sshow_2018-02-28_211514.avi" +++
    +++ "" "" ""
    

    What am I doing wrong ?

    Pablo J. RoginaP 1 Reply Last reply
    0
    • H haifisch

      I need to get the metadata from the video file:

      QMediaMetaData::GPSLatitude,QMediaMetaData::GPSLongitude and  QMediaMetaData::DateTimeOriginal.
      

      I do it this way:

      QMediaPlayer *player = new QMediaPlayer(this);
      player->setMedia(QUrl::fromLocalFile(model->index(i,1).data().toString()));
      QString GPSLatitudeVideo = "";
      QString GPSLongitudeVideo = "";
      QString DateTimeOriginalVideo = "";
      qDebug()<<model->index(i,1).data().toString()<<"+++";
      
      //if (player->isMetaDataAvailable())
      //{
      /* YOUR CODE HERE SUCH AS*/
          GPSLatitudeVideo = player->metaData(QMediaMetaData::GPSLatitude).toString();
          GPSLongitudeVideo = player->metaData(QMediaMetaData::GPSLongitude).toString();
          DateTimeOriginalVideo = player->metaData(QMediaMetaData::DateTimeOriginal).toString();
          qDebug()<<"+++"<<GPSLatitudeVideo<<GPSLongitudeVideo<<DateTimeOriginalVideo;
      //}
      

      But metadata is not displayed:

      "I://Сб_апр_21_2018_21_45_56/sshow_2018-02-28_211514.avi" +++
      +++ "" "" ""
      

      What am I doing wrong ?

      Pablo J. RoginaP Offline
      Pablo J. RoginaP Offline
      Pablo J. Rogina
      wrote on last edited by
      #2

      @haifisch are you sure that your video really has such metadata inside it?

      Have you tried displaying the metadata you're interested in with some other tool, i.e. ffmpeg? something like this:

      ffmpeg -i my_video.avi -hide_banner
      

      In addition, your code snippet has Qt's check for metadata available disabled, why is that?

      Upvote the answer(s) that helped you solve the issue
      Use "Topic Tools" button to mark your post as Solved
      Add screenshots via postimage.org
      Don't ask support requests via chat/PM. Please use the forum so others can benefit from the solution in the future

      H 3 Replies Last reply
      2
      • Pablo J. RoginaP Pablo J. Rogina

        @haifisch are you sure that your video really has such metadata inside it?

        Have you tried displaying the metadata you're interested in with some other tool, i.e. ffmpeg? something like this:

        ffmpeg -i my_video.avi -hide_banner
        

        In addition, your code snippet has Qt's check for metadata available disabled, why is that?

        H Offline
        H Offline
        haifisch
        wrote on last edited by
        #3

        @Pablo-J.-Rogina QMediaMetaData::DateTimeOriginal These metadata, at least there are.

        In addition, your code snippet has Qt's check for metadata available disabled, why is that?
        

        I took this example here.

        1 Reply Last reply
        0
        • Pablo J. RoginaP Pablo J. Rogina

          @haifisch are you sure that your video really has such metadata inside it?

          Have you tried displaying the metadata you're interested in with some other tool, i.e. ffmpeg? something like this:

          ffmpeg -i my_video.avi -hide_banner
          

          In addition, your code snippet has Qt's check for metadata available disabled, why is that?

          H Offline
          H Offline
          haifisch
          wrote on last edited by
          #4

          @Pablo-J.-Rogina said in Why is the metadata of a video file not displayed?:

          ffmpeg

          How to ffmpeg into my application?

          aha_1980A 1 Reply Last reply
          0
          • H haifisch

            @Pablo-J.-Rogina said in Why is the metadata of a video file not displayed?:

            ffmpeg

            How to ffmpeg into my application?

            aha_1980A Offline
            aha_1980A Offline
            aha_1980
            Lifetime Qt Champion
            wrote on last edited by
            #5

            @haifisch You run ffmpeg on the command line...

            Qt has to stay free or it will die.

            H 1 Reply Last reply
            1
            • Pablo J. RoginaP Pablo J. Rogina

              @haifisch are you sure that your video really has such metadata inside it?

              Have you tried displaying the metadata you're interested in with some other tool, i.e. ffmpeg? something like this:

              ffmpeg -i my_video.avi -hide_banner
              

              In addition, your code snippet has Qt's check for metadata available disabled, why is that?

              H Offline
              H Offline
              haifisch
              wrote on last edited by
              #6

              @Pablo-J.-Rogina ![Meta data](0_1535192190305_Metadata.jpg image url)

              1 Reply Last reply
              0
              • aha_1980A aha_1980

                @haifisch You run ffmpeg on the command line...

                H Offline
                H Offline
                haifisch
                wrote on last edited by
                #7

                @aha_1980 0_1535192307013_ffmpeg.jpg

                1 Reply Last reply
                0

                • Login

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • Users
                • Groups
                • Search
                • Get Qt Extensions
                • Unsolved